package wei.xinya.core.Inner;
public class Outer {
    public static void main(String[] args) {
        Outer outer = new Outer();
        Inner inner = outer.getInner("Inner");
        System.out.println(inner.getName());
    }

    public Inner getInner(final String name) {
        return new Inner() {
            private final String nameStr = name;

            public String getName() {
                return nameStr;
            }
        };
    }
}

//注释后，编译时提示类Inner找不到
 interface Inner {
    String getName();
}